/*
 * Created by LiuYou on 2020/12/30.
 *
 */

#ifndef OPERATINGSYSTEM_PCB_HPP
#define OPERATINGSYSTEM_PCB_HPP


#include <string>
#include <memory>
#include "ProcessState.hpp"
#include "Class.hpp"

namespace ProcessSchedule {
    class Pcb : public Class {
    public:
        explicit Pcb(std::string processName, int executeTime = 0, short priority = 0,
                     ProcessState processState = ProcessState::READY);

        Pcb(std::string processName, int executeTime, short priority, std::shared_ptr<Pcb> next,
            ProcessState processState = ProcessState::READY);

        ~Pcb() override;

        const std::string& getProcessName() const;

        int getExecuteTime() const;

        short getPriority() const;

        ProcessState getProcessState() const;

        const std::shared_ptr<Pcb>& getNext() const;

        void setNext(const std::shared_ptr<Pcb>& next);

        void setProcessName(const std::string& processName);

        void setExecuteTime(int executeTime);

        void setPriority(short priority);

        void setProcessState(ProcessState processState);

        std::string toString() override;

    private:
        std::string processName;
        int executeTime;
        short priority;
        ProcessState processState;
        std::shared_ptr<Pcb> next;

    };

}


#endif //OPERATINGSYSTEM_PCB_HPP
